<me:UIWDECK x:Class="WPFExcelReport.TZPRWD02"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:WH="clr-namespace:WPFExcelReport;assembly=TLAGPL"   
                    xmlns:WS="clr-namespace:WPFExcelReport;assembly=TWASTAMM"  
                    xmlns:WF="clr-namespace:WPFExcelReport;assembly=TWAFARBEN"   
                    xmlns:LS="clr-namespace:WPFExcelReport;assembly=TLIEFDAT"   
                    xmlns:VF="clr-namespace:WPFExcelReport;assembly=TVAFARBEN"  
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIWDECK.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>      
        <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:PNumConverter x:Key="pnum"/>
    </me:UIWDECK.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0"   Grid.Column="0" >
            <WrapPanel >
                <Button   Click="UnSelectCommand" Height="20" Margin="5,0,0,0" Width="20">
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Refresh.png" />
                    </Button.Background>
                </Button>
                <Button    Click="QueryCommand" Height="20" Margin="5,0,0,0" Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                    </Button.Background>
                </Button>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=品种:}}"></TextBlock>
                    <ex:AutoTrimTextBox MaxLength="24" Grid.Column="1" CharacterCasing="Upper" Text="{Binding ART,ElementName=TV}" Width="180" />
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=色号:}}"></TextBlock>
                    <ex:AutoTrimTextBox MaxLength="10" Grid.Column="1" CharacterCasing="Upper" Text="{Binding FARBE,ElementName=TV}" Width="80" />
                </Grid>
                <WrapPanel>
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=类型:}}"/>
                    <TextBlock Text="{Binding AUFART,ElementName=TV}" Width="Auto" />
                    <TextBlock Text="{Binding ARTST,ElementName=TV}" Width="Auto"/>
                    <TextBlock Text="{Binding WZTYP,ElementName=TV}" Width="Auto"/>
                    <TextBlock Text="{Binding WDSA,ElementName=TV}" Width="Auto" />
                    <TextBlock Text="{Binding AUFART,ElementName=TV}" Width="Auto" /> 
                    <TextBlock Grid.Column="0" Visibility="Collapsed" Text="{Binding Source={Localization:Translate Word=单号:}}"></TextBlock>
                    <ex:TXT72 MaxLength="2" Grid.Column="1"  Visibility="Collapsed" Text="{Binding KRS,ElementName=TV}" Width="30" />
                    <ex:TXT72 MaxLength="6" Grid.Column="2"   Visibility="Collapsed" Text="{Binding LFD,ElementName=TV}" Width="80" />
                    <ex:TXT72 MaxLength="3" Grid.Column="3"  Visibility="Collapsed" Text="{Binding POS,ElementName=TV}" Width="40" />
                </WrapPanel>
               
            </WrapPanel>
        </StackPanel>
        <DataGrid   Grid.Row="1"   Grid.Column="0"   
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   IsReadOnly="True"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"   
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster"  
                   RowDetailsVisibilityMode="Visible"  
                    >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=WDAUFKRS}" Header=""  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WDAUFLFD,Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:Translate Word=生产单}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WDAUFPOS,Converter={StaticResource ResourceKey=pnum}}" Header=""  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WDBEDARF,Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=供应}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABARESMG,Converter={StaticResource ResourceKey=d1000}}" Header="{Binding Source={Localization:Translate Word=被预留}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WDDAT,Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />
            </DataGrid.Columns>
        </DataGrid  >
    </Grid>

</me:UIWDECK>
